import re

# 支撑WGSI协议
def application(environ, start_response):
    start_response('200 OK', [('Content-Type', 'text/html;charset=UTF-8')])
    # 接受需要打开的文件路径
    print("动态file_path= ", environ['REQUEST_URI'])

    file_path = re.sub(r".py", ".html", environ['REQUEST_URI'])

    with open(file_path,"rb") as f:
        response_body = f.read()

    return response_body